﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using MXERP.Blazor.Components;
using MXERP.Blazor.Interop;

namespace MXERP.Blazor.Extensions
{
    public static class ServiceCollectionExtensions
    {
        public static IServiceCollection AddMXERPBlazorServices(this IServiceCollection services)
        {
            return services.AddMudLocalization();
        }
        /// <summary>
        /// Adds the services required for translations.
        /// </summary>
        /// <param name="services">IServiceCollection</param>
        public static IServiceCollection AddMudLocalization(this IServiceCollection services)
        {
            //services.TryAddTransient<MXERP.Blazor.Services.ILocalizationInterceptor, MXERP.Blazor.Services.DefaultLocalizationInterceptor>();
            //services.TryAddTransient<InternalMudLocalizer>();
            services.TryAddTransient<OutsideClickJsInterop>();
            services.TryAddTransient<OutsideMouseEnterJsInterop>();
            services.TryAddTransient<IMdScrollManager, MdScrollManager>();
            //services.TryAddScoped<IErrorHandler, ErrorHandler>();
            return services;
        }
    }
}
